#include <stdio.h>

void main(){
	int i=0,i1[3][3],j=0;
	int *p1=i1[0];
	while (i<9){
		scanf("%d", p1);
		p1++;
		i++;
	} 
	p1=i1[0];
	for (i=1;i<=9;i++){
		printf("%d ",*(p1+j));
		if ( i%3==0 ){
			printf("\n");
		}
		j=i/3+(i%3)*3;
	}
	
}
